import Vue from 'vue'
import Router from 'vue-router'
import Login from '@/views/Login'
import Index from '@/views/Index'
import Detail from '@/views/Detail'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/login',
      name: 'login',
      component: Login
    },
    {
      path: '/index',
      name: 'index',
      component: Index
    },
    {
      path: '/detail',
      name: 'detail',
      component: Detail
    },
    {
      path: '/:id/detail',
      name: 'detail',
      component: Detail
    },
    {
    /* 此处配置相当于配置了一个404  所有找不到的路由 都跳到这里 */
      path: '/',
      redirect: '/index'
    }
  ]
})
